Summary: Total Attendance by Type
theme_park |>
filter(
Region != c("Worldwide")
) |>
group_by(Year, Type) |>
mutate(
Attendance = Attendance / 100000
) |>
summarise(sum = sum(Attendance)) |>
arrange(Type) |>
pivot_wider(
names_from = Type,
values_from = sum
) |>
knitr::kable(digits = 3, caption = c("Summary of Attendance for Three Types of Facilities From 2019 to 2022"))
## `summarise()` has grouped output by 'Year'. You can override using the
## `.groups` argument.
Summary of Attendance for Three Types of Facilities From 2019
to 2022
| 2019 |
37996.4 |
20100.8 |
5898.9 |
| 2020 |
13031.1 |
4664.5 |
2313.5 |
| 2021 |
22463.7 |
6459.0 |
3473.5 |
| 2022 |
21280.8 |
11603.3 |
4678.3 |
theme_park |>
group_by(Year) |>
plot_ly(y = ~Attendance, color = ~Year, type = "box", colors = "viridis")
theme_park|>
filter(
Region != c("Worldwide")
) |>
group_by(Region, Year) |>
summarize(attend_sum = mean(Attendance)) |>
plot_ly(x = ~Year, y = ~attend_sum, color = ~Region,
type = "scatter", mode = 'point', colors = "viridis")
## `summarise()` has grouped output by 'Region'. You can override using the
## `.groups` argument.